package com.cx.mall.goods.controller;

import com.cx.mall.common.entity.goods.entity.Brand;
import com.cx.mall.common.util.ResponseVo;
import com.cx.mall.goods.service.IBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 品牌表 前端控制器
 * </p>
 *
 * @author zs
 * @since 2025-08-07
 */
@RestController
@RequestMapping("/goods/brand/category")
public class BrandController {
    @Autowired
    private IBrandService brandService;

    @GetMapping("/3/{id}")
    public ResponseVo<List<Brand>> getBrandListByThreeCategoryId(@PathVariable("id") Integer id) {
        List<Brand> brandList = brandService.getBrandListByThreeCategoryId(id);
        return ResponseVo.success(brandList);
    }

    @GetMapping("/2/{id}")
    public ResponseVo<List<Brand>> getBrandListByTwoCategoryId(@PathVariable("id") Integer id) {
        List<Brand> brandList = brandService.getBrandListByTwoCategoryId(id);
        return ResponseVo.success(brandList);
    }

    @GetMapping("/1/{id}")
    public ResponseVo<List<Brand>> getBrandListByOneCategoryId(@PathVariable("id") Integer id) {
        List<Brand> brandList = brandService.getBrandListByOneCategoryId(id);
        return ResponseVo.success(brandList);
    }

}
